package me.jessyan.mvparms.demo.mvp.ui.adapter;

import android.view.View;

import com.jess.arms.base.BaseHolder;
import com.jess.arms.base.DefaultAdapter;

import java.util.List;
import java.util.regex.Pattern;

import me.jessyan.mvparms.demo.R;
import me.jessyan.mvparms.demo.mvp.ui.holder.MyExchangeHolder;
import me.jessyan.mvparms.demo.mvp.ui.holder.MyExchangeTypeHolder;

/**
 * @author DrChen
 * @Date 2019/3/6 0006.
 * qq:1414355045
 */
public class MyExchangeAdapter extends DefaultAdapter<Boolean>{
    public MyExchangeAdapter(List<Boolean> infos) {
        super(infos,true);
    }

    @Override
    public BaseHolder<Boolean> getHolder(View v, int viewType) {
        if(viewType==1){
            return  new MyExchangeTypeHolder(v);
        }else {
            return new MyExchangeHolder(v);
        }

    }

    @Override
    public int getItemViewType(int position) {
        if(mInfos.get(position)){
            return 1;
        }else {
            return 2;
        }


    }

    @Override
    public int getLayoutId(int viewType) {
        if(viewType==1){
            return R.layout.item_my_exchange_type;
        }else {
            return R.layout.item_my_exchange;
        }
        }



}
